package io.terminus.spzx.user.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.terminus.spzx.model.vo.common.Result;
import io.terminus.spzx.model.vo.common.ResultCodeEnum;
import io.terminus.spzx.user.service.SmsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author lichunlong lcl253137@alibaba-inc.com
 * @Desc 阿里云SMS短信服务Controller
 * @Date 2024-11-16
 */
@RestController
@RequiredArgsConstructor
@Tag(name = "阿里云SMS短信服务接口")
@RequestMapping(value = "/api/user/sms")
public class SmsController {

    private final SmsService smsService;

    @GetMapping(value = "/sendCode/{phone}")
    public Result<Void> sendValidateCode(@PathVariable String phone) {
        smsService.sendValidateCode(phone);

        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
}
